from vector import *
from rendering import *
from entityManager import *
import resources
def AngleToTarget(pos,target):
     dx = target.get()[0] - pos.get()[0]
     dy = target.get()[1] - pos.get()[1]
     return -math.degrees(math.atan2(dy,dx))
class sprinter:
    def __init__(self,pos,screen):
        self.body = i_object("./Entities/graphics/sprinter.png",screen)
        self.body.alpha()
        self.health = 100
        self.pos = pos
        entityList.append(self)
        enemyList.append(self)
    def hurt(self,val):
        self.health  = self.health - val
    def getPos(self):
        return self.pos
    def remove(self):
        resources.Money = resources.Money + 10
        buffer.remove(self)
        enemyList.remove(self)
        del(self)
    def draw(self):
        self.body.draw(self.pos)
    def think(self):
        if self.health > 0:
            self.pos.add(vector(1,0))
            self.draw()
        else:
            self.remove()
wave = [sprinter,sprinter,sprinter]
